home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
gfx
/
opal
/
DropShadow.lha
/
Bevel+Stencil.oprx
< prev
next >
Wrap
Text File
|
1993-04-29
|
2KB
|
100 lines
/* Draw a bevelled drop box, plus a stencil mask, using OpalPaint.
*/
address 'OpalPaint_Rexx'
options Results
SaveSetUp
GetRect
parse var Result X1 Y1 X2 Y2
Width = X2-X1
Height = Y2-Y1
If Width < Height then MaxDepth = (Width/2)%1
If Height < Width then MaxDepth = (Height/2)%1
/* AskInt 0 MaxDepth 10 "Enter bevel depth in pixels (RETURN = 10)" */
AskProp 0 MaxDepth 10 "Select bevel depth (in pixels)."
Depth = Result /* Set depth of bevel */
GetPen
RGBtoHSV Result
Parse var Result Hue Sat Val
/* Make a stencil mask of the bevel box area */
WorkMode STENCIL
SolidRect X1 Y1 X2 Y2-1
WorkMode IMAGE
StenEnable 0
/* Box body. Set up a diagonal HSV gradient */
FillMode Gradient
ClearColGrad
ClearTransGrad
ColourDither 0
TransDither 0
HSVtoRGB Hue Sat Val
ColGradTag 0 Result
S2 = (Sat-(0.4*65535))%1 /* Note: %1 converts number to an integer */
S2 = MAX(S2,0)
HSVtoRGB Hue S2 Val
ColGradTag 0.5 Result
HSVtoRGB Hue Sat Val
ColGradTag 1 Result
GradType LinearFree HSV
GradRange X1+Depth Y1+Depth X2-Depth Y2-Depth
SolidRect X1+Depth Y1+Depth X2-Depth Y2-Depth
FillMode Solid
/* Top */
V2 = (Val+0.1*65535)%1
V2 = MIN(V2,65535)
HSVtoRGB Hue Sat V2
SetPen Result
SolidPoly X1 Y1 X2 Y1 X2-Depth Y1+Depth X1+Depth Y1+Depth X1 Y1
LastPoint
/* Right */
V2 = (Val-0.15*65535)%1
V2 = MAX(V2,0)
HSVtoRGB Hue Sat V2
SetPen Result
SolidPoly X2 Y1 X2 Y2 X2-Depth Y2-Depth X2-Depth Y1+Depth X2 Y1
LastPoint
/* Left */
V2 = (Val+0.15*65535)%1
V2 = MIN(V2,65535)
HSVtoRGB Hue Sat V2
SetPen Result
SolidPoly X1 Y1 X1+Depth Y1+Depth X1+Depth Y2-Depth X1 Y2 X1 Y1
LastPoint
/* Bottom */
V2 = (Val-0.1*65535)%1
V2 = MAX(V2,0)
HSVtoRGB Hue Sat V2
SetPen Result
SolidPoly X2 Y2 X1 Y2 X1+Depth Y2-Depth X2-Depth Y2-Depth X2 Y2
LastPoint
RestoreSetUp